Skip to content

Conversation

@stephenfuqua
Copy link
Contributor

@stephenfuqua stephenfuqua commented Nov 12, 2025

Simple tool for validating JSON files using OpenAPI specifications.

GitHub Actions workflows are functional, as shown when I merged to main in a fork: sample pull request

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a JSON file validator application for validating JSON files against OpenAPI specifications, specifically designed for Ed-Fi data lake structures.

Key Changes:

  • Python-based JSON validator with CLI and programmatic API interfaces
  • Support for local and remote OpenAPI specifications (JSON/YAML)
  • Comprehensive test suite with fixtures and sample data
  • GitHub Actions workflows for CI/CD and security scanning

Reviewed Changes

Copilot reviewed 24 out of 25 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
python/json_validator/validator.py Core validation logic implementing schema mapping and JSON validation
python/json_validator/main.py Command-line interface with argparse for user interaction
python/tests/test_validator.py Unit tests for validator functionality
python/tests/test_cli.py Unit tests for CLI interface
python/tests/conftest.py Pytest fixtures providing test data and temporary file structures
python/pyproject.toml Poetry project configuration with dependencies
python/poetry.lock Locked dependency versions for reproducible builds
simulated-lake/spec/simplified-ds-6.0.yaml OpenAPI specification for test validation
simulated-lake/tpdm/candidates/*.json Test data files (valid and invalid samples)
simulated-lake/ed-fi/assessments/*.json Test data files for assessment entities
.github/workflows/*.yml CI/CD workflows for testing and security scanning
python/README.md, python/USAGE.md Documentation for installation and usage

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

{
"id": "40ed08411356433d8e5ea259aa0dce86",
"candidateIdentifier": "1000043",
"birthDate": 1974,
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The birthDate field has an incorrect data type. According to the OpenAPI spec and the tpdm_candidate schema (lines 117-119 in conftest.py), birthDate should be a string with format "date", not an integer. The value 1974 should be "1974-XX-XX" format.

Suggested change
"birthDate": 1974,
"birthDate": "1974-01-01",

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a very nice catch by Copilot. Of course, in this case, that's exactly the point: I wanted it to be wrong.

"streetNumberName": "47 East Cowley Street",
"buildingSiteNumber": "50",
"doNotPublishIndicator": false,
"periods": [1,2,3]
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The periods field contains an array of integers [1,2,3], but based on the schema pattern in the OpenAPI spec (line 100), periods should be an array of objects with specific properties, not an array of integers.

Suggested change
"periods": [1,2,3]
"periods": [
{ "periodNumber": 1 },
{ "periodNumber": 2 },
{ "periodNumber": 3 }
]

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, good catch, but it was deliberately done.

"id": "40ed08411356433d8e5ea259aa0dce86",
"candidateIdentifier": "1000043",
"birthDate": 1974,
"economicDisadvantaged": "yes",
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The economicDisadvantaged field has an incorrect data type. It should be a boolean value (true or false), not a string ("yes"). This will fail JSON schema validation.

Suggested change
"economicDisadvantaged": "yes",
"economicDisadvantaged": true,

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants